package com.aaa.service;

import com.aaa.dao.UserRightDao;
import com.aaa.pojo.ChangeMoney;
import com.aaa.pojo.LoanInfo;
import com.aaa.pojo.MyLoan;
import com.aaa.pojo.UserRight;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRightService {
    @Autowired
    private UserRightDao userRightDao;
    // 查询 网贷审核 分页
    public PageInfo<UserRight> getChangeByPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);//表示从pageNum页开始，每页pageSize条数据
        List<UserRight> userRights = userRightDao.selectAll();
        PageInfo<UserRight> pageInfo = new PageInfo<>(userRights);
        return pageInfo;
    }
    //修改  审核通过
    public boolean update1(String ml_id){
        return userRightDao.update1(ml_id);
    }
    //修改  审核不通过
    public boolean update2(String ml_id){
        return userRightDao.update2(ml_id);
    }


    // 查询 网贷信息  分页
    public PageInfo<LoanInfo> getChangeByPageInfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);//表示从pageNum页开始，每页pageSize条数据
        List<LoanInfo> loanInfos = userRightDao.selectInfo();
        PageInfo<LoanInfo> pageInfo = new PageInfo<>(loanInfos);
        return pageInfo;
    }
}
